package com.zb.feigns;

import com.zb.config.HeimaFeignAutoConfiguration;
import com.zb.feigns.fallback.ArticleFeignFallback;
import com.zb.model.common.Result;
import com.zb.model.pojo.article.ApAuthor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "article-service",
        fallbackFactory = ArticleFeignFallback.class,
        configuration = HeimaFeignAutoConfiguration.class
)
public interface ArticleFeign {
    @GetMapping("/api/v1/author/findByUserId/{userId}")
    Result<ApAuthor> findByUserId(@PathVariable("userId") Integer userId);
    @PostMapping("/api/v1/author/save")
    Result save(@RequestBody ApAuthor apAuthor);
}
